//
//  LPTCategoryModel.m
//  LPTClient
//
//  Created by mac on 2018/12/10.
//  Copyright © 2018年 zhaodd. All rights reserved.
//

#import "LPTCategoryModel.h"

@implementation LPTCategoryModel

+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper
{
    return @{
             @"cateId" : @"id",
             };
}

+ (nullable NSDictionary<NSString *, id> *)modelContainerPropertyGenericClass
{
    return @{
             @"chinese_medicines" : LPTMedicineModel.class,
             };
}

-(id)copyWithZone:(NSZone *)zone
{
    LPTCategoryModel *model = [[[self class] allocWithZone:zone] init];
    model.name = self.name;
    model.cateId = self.cateId;
    model.chinese_medicines = [[NSArray alloc] initWithArray:self.chinese_medicines copyItems:YES];
    return model;
}

-(id)mutableCopyWithZone:(NSZone *)zone
{
    LPTCategoryModel *model = [[[self class] allocWithZone:zone] init];
    model.name = self.name;
    model.cateId = self.cateId;
    model.chinese_medicines = [[NSArray alloc] initWithArray:self.chinese_medicines copyItems:YES];
    return model;
}

@end

@implementation LPTMedicineModel

+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper
{
    return @{
             @"medicineId" : @"id",
             };
}

-(void)setName:(NSString *)name
{
    _name = name;
    
    _count = 0;
}

-(id)copyWithZone:(NSZone *)zone
{
    LPTMedicineModel *model = [[[self class] allocWithZone:zone] init];
    model.medicineId = self.medicineId;
    model.name = self.name;
    model.price = self.price;
    model.count = self.count;
    return model;
}

- (id)mutableCopyWithZone:(nullable NSZone *)zone
{
    LPTMedicineModel *model = [[[self class] allocWithZone:zone] init];
    model.medicineId = self.medicineId;
    model.name = self.name;
    model.price = self.price;
    model.count = self.count;
    return model;
}


@end
